﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class datalist : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        DataTable dt = new DataTable();
        dt.Columns.Add("数字");
        dt.Columns.Add("平方");

        DataRow dr;

        for (int i = 0; i < 10;i++ )
        {
            dr = dt.NewRow();
            dr[0] = i;
            dr[1] = i * i;
            dt.Rows.Add(dr);
        }

        this.DataList1.DataSource = dt;
        this.DataList1.DataBind();

    }
}
